package Page.DetailPage;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;

import java.net.URL;
import java.util.ResourceBundle;

public class DetailPageController implements Initializable {
    @FXML
    public TextArea Content;
    @FXML
    public Label Info;
    @FXML
    public Label Title;


    @Override
    public void initialize(URL location, ResourceBundle resources) {
        Title.textProperty().bind(DetailPageViewModel.getViewModel().getTitleProperty());
        Info.textProperty().bind(DetailPageViewModel.getViewModel().getInfoProperty());
        Content.textProperty().bindBidirectional(DetailPageViewModel.getViewModel().getContentProperty());
    }

    public void setTitle(String title) {
        this.Title.setText(title);
    }

    public void setContent(String content) {
        this.Content.setText(content);
    }

    public void setInfo(String info) {
        this.Info.setText(info);
    }
}
